package net.stogi.common.gwt.dispatch.client.core;

import net.stogi.common.gwt.dispatch.server.core.Dispatch;
import net.stogi.common.gwt.dispatch.shared.core.Action;
import net.stogi.common.gwt.dispatch.shared.core.Result;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

/**
 * There currently seem to be GWT compilation problems with services that use
 * generic templates in method parameters. As such, they are stripped here, but
 * added back into the {@link Dispatch} and {@link DispatchAsync}, which are the
 * interfaces that should be accessed by regular code.
 * <p>
 * Once GWT can compile templatized methods correctly, this should be merged
 * into a single pair of interfaces.
 */
@RemoteServiceRelativePath("../gwtrpc/dispatch")
public interface DispatchService extends RemoteService {

	Result execute(Action<?> action) throws Exception;
}
